<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>零件管理</title>
<%
	String sid = request.getParameter("secondMenuId");
	request.getSession().setAttribute("secondMenuId", sid);
%>
<%@include file="/jsp/include/common.jsp"%>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/assets/ui/jquery-easyui-1.4.1/extend/tree.loadFilter.js"></script>
</head>
<body class="easyui-layout">
	<%@include file="/jsp/include/commonLayout.jsp"%>
	<div data-options="region:'center'">
	     <div class="easyui-layout" data-options="fit:true">   
		     <div data-options="region:'north'" style="padding:10px">
			     <div>
			     	<button class="easyui-linkbutton" iconCls="icon-ok" onclick="back()">保存</button>
			     	<button class="easyui-linkbutton" iconCls="icon-cancel" onclick="back()">取消</button>
			     	<button class="easyui-linkbutton" iconCls="icon-tip" onclick="back2()">生成二维码</button>
			     	<button class="easyui-linkbutton" iconCls="icon-undo" onclick="back1()">整车详情</button>
			     </div>
		     </div>
			 <div data-options="region:'west'" style="width:200px" >
				 <div title="快速查找" data-options="iconCls:'icon-search',collapsed:false,collapsible:false"
					style="padding: 10px;">
					<input class="easyui-searchbox" prompt="查找" style="width:160px; height:30px;">
				 </div>
				 <ul id="partTree" class="easyui-tree"></ul>  
			 </div>
             <div data-options="region:'center'" >
             	<div class="easyui-layout" data-options="fit:true">
             		<div data-options="region:'north',minHeight:140">
						<div style="margin-top: 20px">
							<div style="float:left;">
								<img onclick="listUser()" style="weight:100px;width:200px;margin-left: 20px"
									 alt="" src="<%=request.getContextPath()%>/assets/img/carload1.png">
							</div>
							<div style="width:50px;float:left">
								&nbsp;
							</div>
							<div style="margin-right:50px;">
								<table>
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									<tr id="2014">
										<td style="width:100px;text-align: right;">零件编号</td>
										<td><input id="2014userid1" value="A61-007-LT1"name="userid" class="easyui-textbox" data-options="disabled:true" ></td>
										<td style="width:100px;text-align: right;">零件名称</td>
										<td><input id="email1" name="email" value="前置轮胎" class="easyui-textbox" data-options="disabled:true"></td>
										<td style="width:100px;text-align: right;">尺寸（半径）</td>
										<td><input name="phone1" value="25cm" class="easyui-textbox" data-options="disabled:true"></td>
									</tr>
									<tr>
										<td style="width:100px;text-align: right;">重量</td>
										<td><input name="odesc1" value="15kg" class="easyui-textbox"data-options="disabled:true" ></td>
										<td style="width:100px;text-align: right;">工艺</td>
										<td><input name="price1" value="模具冲压" class="easyui-textbox"data-options="disabled:true" ></td>
										<td style="width:100px;text-align: right;">材料</td>
										<td><input name="price1" value="合成橡胶" class="easyui-textbox"data-options="disabled:true" ></td>
									</tr>
								</table>
							</div>
						</div>
             		</div>
             		<div data-options="region:'center'" style="">
             			<div id="tabs" class="easyui-tabs" data-options="fit:true">
             				<div title="基本信息" style="padding-top: 20px;padding-left: 20px">  
       			 				<table style="text-align: right;">
       			 					<tr>
										<td style="width:145px;">品牌</td>
										<td>
											<select id="brand" name="brand"  class="easyui-combobox"  style="width:135px;">   
												<option>奥迪</option>
												<option>宝马</option>
												<option>马自达</option>
											</select>  
										</td>
										<td style="width:145px;">车型</td>
										<td>
											<select id="brand" name="brand"  class="easyui-combobox"  style="width:135px;">   
												<option>手自一体基本型</option>
											</select>  
										</td>
										<td style="width:145px;">底盘号</td>
										<td><input id="email" name="email" value="DP67200" class="easyui-textbox"></td>
										<td style="width:145px;">零件号</td>
										<td><input id="email" name="email" value="61130####"class="easyui-textbox"></td>
									</tr>
									<tr>
										<td>类型</td>
										<td><input id="email" name="email" value="总成" class="easyui-textbox"></td>
										<td></td>
										<td></td>
										<td></td>
										<td></td>
										<td></td>
										<td></td>
									</tr>
       			 				</table>
       			 				
       			 				<B>零件基本信息</B><br>
       			 				<div class="datagrid-toolbar"></div><br>
			       				<table style="text-align: right;">
									<tr>
										<td style="width:145px;">尺寸</td>
										<td><input id="userid" value="12.3" name="userid" class="easyui-textbox"></td>
										<td style="width:145px;">工艺 </td>
										<td><input id="userid" value="VASB" name="userid" class="easyui-textbox"></td>
										<td style="width:145px;">零件名称</td>
										<td><input id="userid" value="空调器总成" name="userid" class="easyui-textbox"></td>
										<td style="width:145px;">重量(g)</td>
										<td><input id="userid" value="307.9" name="userid" class="easyui-textbox"></td>
									</tr>
									<tr>
										<td style="width:145px;">价格 </td>
										<td><input id="userid" value="2000" name="userid" class="easyui-textbox"></td>
										<td style="width:145px;">材料</td>
										<td><input id="userid" value="S" name="userid" class="easyui-textbox"></td>
										<td style="width:145px;">供应商 </td>
										<td><input id="userid" value="延峰电子"  name="userid" class="easyui-textbox"></td>
										<td style="width:145px;">数量</td>
										<td><input id="userid" value="2"  name="userid" class="easyui-textbox"></td>
									</tr>
								</table>
								<br><B>零件优势信息描述</B><br>
								<div class="datagrid-toolbar"></div><br>
								<table style="text-align: right;">
									<tr>
										<td style="width:145px;">一般信息</td>
										<td><input id="userid" value=""  name="userid" class="easyui-textbox"></td>
										<td style="width:145px;"> 工时节省 </td>
										<td><input id="userid" value=""  name="userid" class="easyui-textbox"></td>
										<td style="width:145px;">降低成本</td>
										<td><input id="userid" value=""  name="userid" class="easyui-textbox"></td>
										<td style="width:145px;"> 技术亮点 </td>
										<td><input id="userid" value=""  name="userid" class="easyui-textbox"></td>
									</tr>
								</table>
		       			 	</div>
		       			 	
			    			 <div title="图片"  style="overflow:auto;padding:20px;">
	    			 			 <div style="float:left; width:30%;">
				    			 	<img alt="" src="<%=request.getContextPath()%>/assets/img/41503448_200.jpg" style=" vertical-align:middle;"></br>整车平视</br>
				        		 	<input class="easyui-filebox" style="width:200px"><br><br>
				    			 </div>
				    			 <div style="float:left;width:30%;">
				    			 	<img alt="" src="<%=request.getContextPath()%>/assets/img/zhengqian45.jpg" style=" vertical-align:middle;"></br>前45'平视</br>
				        		 	<input class="easyui-filebox" style="width:200px"><br><br>
				    			 </div>
				    			 <div>
				    			 	<img alt="" src="<%=request.getContextPath()%>/assets/img/chetou.jpg" style=" vertical-align:middle;"></br>车头平视</br>
				        		 	<input class="easyui-filebox" style="width:200px"><br><br>
				    			 </div>
				    			 <div style="float:left;width:30%;">
				    			 	<img alt="" src="<%=request.getContextPath()%>/assets/img/cheshen.jpg" style=" vertical-align:middle;"></br>车身平视</br>
				        		 	<input class="easyui-filebox" style="width:200px">
				        		 </div>
				        		 <div style="float:left;width:30%;">
				    			 	<img alt="" src="<%=request.getContextPath()%>/assets/img/car_view1.jpg" style=" vertical-align:middle;width:200px;height:133px"></br>车身平视</br>
				        		 	<input class="easyui-filebox" style="width:200px">
				        		 </div>
				        		 <div>
				    			 	<img alt="" src="<%=request.getContextPath()%>/assets/img/car_view2.jpg" style=" vertical-align:middle;width:200px;height:133px"></br>车身平视</br>
				        		 	<input class="easyui-filebox" style="width:200px">
				        		 </div>
			   				 </div>   
			    			 <div title="附件"  style="padding:10px;">
			        			<table id="dataGrid"></table>
			    			 </div>
		    			</div>
             		</div>
             	</div>
			</div>
			
			<!-- 添加或编辑用户的弹出窗口 begin -->
			<div id="saveOrEditDlg" class="easyui-dialog"
				style="width: 340px; height: 400px; padding: 10px 10px"
				closed="true" buttons="#dlg-buttons" data-options="modal:true">
				<img  style="text-align: center;width: 300px; height: 300px;" alt="" src="<%=request.getContextPath()%>/assets/img/weixin2.jpg">
			</div>
			<div id="dlg-buttons">
				<a class="easyui-linkbutton" iconCls="icon-ok"
					onclick="javascript:$('#saveOrEditDlg').dialog('close')">继续添加</a>
					<a class="easyui-linkbutton" iconCls="icon-cancel"
					onclick="javascript:$('#saveOrEditDlg').dialog('close')">返回</a>
					 <a class="easyui-linkbutton"
					iconCls="icon-print"
					onclick="javascript:$('#saveOrEditDlg').dialog('close')">打印</a>
			</div>
			<!-- 添加或编辑用户的弹出窗口 end -->
			   
		</div>
	</div>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		// 初始化表格
		var dataGrid = $('#dataGrid').datagrid({
			fit : true,
			rownumbers : true,	//如果为true，则显示一个行号列
			fitColumns : true,	//真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动
			collapsible : true,	//定义是否显示可折叠按钮
			title : '附件信息管理',	//在面板头部显示的标题文本
			pagination : true,	//如果为true，则在DataGrid控件底部显示分页工具栏
			pagePosition : 'bottom',	//定义分页工具栏的位置
			method : 'post', //该方法类型请求远程数据
			url : getRootPath() + '/template/json/car_dataattachment.json',	//一个URL从远程站点请求数据
			singleSelect : false,//只能选一行
			striped : true, //数据条纹显示
			frozenColumns : [ [ {//不可被删除的列
				field : 'ck',	//列字段名称
				checkbox : true	//如果为true，则显示复选框
			} ] ],
			columns : [ [ {
				field : 'userid',
				title : 'ID',
				width : 100,
				sortable : true	//如果为true，则允许列使用排序
			}, {
				field : 'email',
				title : '附件名',
				width : 200
			}, {
				field : 'phone',
				title : '附件类型',
				width : 100
			}, {
				field : 'odesc',
				title : '上传者',
				width : 200
			}, {
				field : 'oid',
				title : '上传时间',
				
			} ] ],
			sortName : 'userid',	//定义哪些列可以进行排序
			toolbar : [{	//顶部工具栏的DataGrid面板
				text : '上传',
				iconCls : 'icon-add',
				handler : function(){
				}
			},{
				text : '下载',
				iconCls : 'icon-edit',
				handler : function(){
				}
			},{
				text : '删除',
				iconCls : 'icon-remove',
				handler : function(){
					var rows = $('#dataGrid').datagrid('getSelections');
					if (rows.length == 0) {
						$.messager.alert('提示', '请选择删除项', 'info');
						return;
					}

					var oids = [];
					for (var i = 0; i < rows.length; i++) {
						oids.push(rows[i].oid);
					}
				}
			}],
		remoteFilter : true,	//设置为true时，启用远程过滤
		filterDelay : 1000,		//延迟过滤 'text' 过滤器组件中最后一次键盘输入事件
		filterStringify : function(data) {	//字符串化过滤器规则的函数
			return JSON.stringify(data);
		} 
		});

		dataGrid.datagrid('enableFilter');
	});
	//异步加载右侧详细信息
	function back() {
		window.location.href=getRootPath()+'/template/dataManage/part/partList.jsp'; 
	}
	function back1() {
		window.location.href=getRootPath()+'/template/dataManage/car/detail.jsp'; 
	}function back2() {
		$('#saveOrEditDlg').dialog('open').dialog('setTitle', '新建模板');
		$('#saveOrEditForm').form('clear');
	}
	 $('#partTree').tree({
	    url: getRootPath()+ '/template/json/treeDemo.json',  
	    parentField:"pid",
	    textFiled:"name",
	    idFiled:"id",
	    onClick:function(node){
	    	if (node.id > 1) {
				window.location.href=getRootPath()+'/template/dataManage/car/treedetail.jsp';
			} else {
				window.location.href=getRootPath()+'/template/dataManage/part/partTreeList.jsp';
			}
		}
	  }); 
</script>
</html>
